home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / isrnnng1.hqx / IsRunning XFCN / cards.xml < prev    next >
Encoding:
Text File  |  1993-03-14  |  25.5 KB  |  506 lines

  1. card_2885.xml
  2. <?xml version="1.0" encoding="utf-8" ?>
  3. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  4. <card>
  5.     <id>2885</id>
  6.     <filler1>0</filler1>
  7.     <bitmap>BMAP_4621.pbm</bitmap>
  8.     <cantDelete> <false /> </cantDelete>
  9.     <showPict> <true /> </showPict>
  10.     <dontSearch> <false /> </dontSearch>
  11.     <owner>2758</owner>
  12.     <link rel="stylesheet" type="text/css" href="stylesheet_3269.css" />
  13.     <part>
  14.         <id>1</id>
  15.         <type>button</type>
  16.         <visible> <true /> </visible>
  17.         <reserved5> 0 </reserved5>
  18.         <reserved4> 0 </reserved4>
  19.         <reserved3> 0 </reserved3>
  20.         <reserved2> 0 </reserved2>
  21.         <reserved1> 0 </reserved1>
  22.         <enabled> <true /> </enabled>
  23.         <rect>
  24.             <left>15</left>
  25.             <top>278</top>
  26.             <right>85</right>
  27.             <bottom>338</bottom>
  28.         </rect>
  29.         <style>transparent</style>
  30.         <showName> <true /> </showName>
  31.         <highlight> <false /> </highlight>
  32.         <autoHighlight> <true /> </autoHighlight>
  33.         <sharedHighlight> <true /> </sharedHighlight>
  34.         <family>0</family>
  35.         <titleWidth>0</titleWidth>
  36.         <icon>21437</icon>
  37.         <textAlign>center</textAlign>
  38.         <font>Chicago</font>
  39.         <textSize>12</textSize>
  40.         <textStyle>plain</textStyle>
  41.         <name>IsRunning</name>
  42.         <script>on mouseUpput card field yup into yoget isRunning(yo)put it&return into card field zozoend mouseUp</script>
  43.     </part>
  44.     <part>
  45.         <id>7</id>
  46.         <type>button</type>
  47.         <visible> <true /> </visible>
  48.         <reserved5> 0 </reserved5>
  49.         <reserved4> 0 </reserved4>
  50.         <reserved3> 0 </reserved3>
  51.         <reserved2> 0 </reserved2>
  52.         <reserved1> 0 </reserved1>
  53.         <enabled> <true /> </enabled>
  54.         <rect>
  55.             <left>391</left>
  56.             <top>131</top>
  57.             <right>445</right>
  58.             <bottom>183</bottom>
  59.         </rect>
  60.         <style>rectangle</style>
  61.         <showName> <true /> </showName>
  62.         <highlight> <false /> </highlight>
  63.         <autoHighlight> <true /> </autoHighlight>
  64.         <sharedHighlight> <true /> </sharedHighlight>
  65.         <family>0</family>
  66.         <titleWidth>0</titleWidth>
  67.         <icon>1004</icon>
  68.         <textAlign>center</textAlign>
  69.         <font>Chicago</font>
  70.         <textSize>12</textSize>
  71.         <textStyle>plain</textStyle>
  72.         <name>Source</name>
  73.         <script>on mouseUpgo nextend mouseUp</script>
  74.     </part>
  75.     <part>
  76.         <id>8</id>
  77.         <type>field</type>
  78.         <visible> <true /> </visible>
  79.         <dontWrap> <false /> </dontWrap>
  80.         <dontSearch> <false /> </dontSearch>
  81.         <sharedText> <false /> </sharedText>
  82.         <fixedLineHeight> <false /> </fixedLineHeight>
  83.         <autoTab> <false /> </autoTab>
  84.         <lockText> <false /> </lockText>
  85.         <rect>
  86.             <left>87</left>
  87.             <top>300</top>
  88.             <right>153</right>
  89.             <bottom>313</bottom>
  90.         </rect>
  91.         <style>rectangle</style>
  92.         <autoSelect> <false /> </autoSelect>
  93.         <showLines> <false /> </showLines>
  94.         <wideMargins> <false /> </wideMargins>
  95.         <multipleLines> <false /> </multipleLines>
  96.         <reservedFamily> 0 </reservedFamily>
  97.         <titleWidth>0</titleWidth>
  98.         <icon>0</icon>
  99.         <textAlign>left</textAlign>
  100.         <font>Geneva</font>
  101.         <textSize>9</textSize>
  102.         <textStyle>bold</textStyle>
  103.         <textHeight>12</textHeight>
  104.         <name>yup</name>
  105.         <script></script>
  106.     </part>
  107.     <part>
  108.         <id>9</id>
  109.         <type>field</type>
  110.         <visible> <true /> </visible>
  111.         <dontWrap> <false /> </dontWrap>
  112.         <dontSearch> <false /> </dontSearch>
  113.         <sharedText> <false /> </sharedText>
  114.         <fixedLineHeight> <false /> </fixedLineHeight>
  115.         <autoTab> <false /> </autoTab>
  116.         <lockText> <false /> </lockText>
  117.         <rect>
  118.             <left>87</left>
  119.             <top>320</top>
  120.             <right>473</right>
  121.             <bottom>332</bottom>
  122.         </rect>
  123.         <style>rectangle</style>
  124.         <autoSelect> <false /> </autoSelect>
  125.         <showLines> <false /> </showLines>
  126.         <wideMargins> <false /> </wideMargins>
  127.         <multipleLines> <false /> </multipleLines>
  128.         <reservedFamily> 0 </reservedFamily>
  129.         <titleWidth>0</titleWidth>
  130.         <icon>0</icon>
  131.         <textAlign>left</textAlign>
  132.         <font>Monaco</font>
  133.         <textSize>9</textSize>
  134.         <textStyle>plain</textStyle>
  135.         <textHeight>12</textHeight>
  136.         <name>zozo</name>
  137.         <script></script>
  138.     </part>
  139.     <part>
  140.         <id>11</id>
  141.         <type>field</type>
  142.         <visible> <true /> </visible>
  143.         <dontWrap> <false /> </dontWrap>
  144.         <dontSearch> <false /> </dontSearch>
  145.         <sharedText> <false /> </sharedText>
  146.         <fixedLineHeight> <false /> </fixedLineHeight>
  147.         <autoTab> <false /> </autoTab>
  148.         <lockText> <true /> </lockText>
  149.         <rect>
  150.             <left>53</left>
  151.             <top>10</top>
  152.             <right>446</right>
  153.             <bottom>62</bottom>
  154.         </rect>
  155.         <style>rectangle</style>
  156.         <autoSelect> <false /> </autoSelect>
  157.         <showLines> <false /> </showLines>
  158.         <wideMargins> <false /> </wideMargins>
  159.         <multipleLines> <false /> </multipleLines>
  160.         <reservedFamily> 0 </reservedFamily>
  161.         <titleWidth>0</titleWidth>
  162.         <icon>0</icon>
  163.         <textAlign>left</textAlign>
  164.         <font>Times</font>
  165.         <textSize>48</textSize>
  166.         <textStyle>bold</textStyle>
  167.         <textHeight>64</textHeight>
  168.         <name>Nom</name>
  169.         <script></script>
  170.     </part>
  171.     <part>
  172.         <id>12</id>
  173.         <type>field</type>
  174.         <visible> <true /> </visible>
  175.         <dontWrap> <false /> </dontWrap>
  176.         <dontSearch> <false /> </dontSearch>
  177.         <sharedText> <false /> </sharedText>
  178.         <fixedLineHeight> <false /> </fixedLineHeight>
  179.         <autoTab> <false /> </autoTab>
  180.         <lockText> <true /> </lockText>
  181.         <rect>
  182.             <left>87</left>
  183.             <top>280</top>
  184.             <right>393</right>
  185.             <bottom>295</bottom>
  186.         </rect>
  187.         <style>rectangle</style>
  188.         <autoSelect> <false /> </autoSelect>
  189.         <showLines> <false /> </showLines>
  190.         <wideMargins> <false /> </wideMargins>
  191.         <multipleLines> <false /> </multipleLines>
  192.         <reservedFamily> 0 </reservedFamily>
  193.         <titleWidth>0</titleWidth>
  194.         <icon>0</icon>
  195.         <textAlign>left</textAlign>
  196.         <font>Geneva</font>
  197.         <textSize>9</textSize>
  198.         <textStyle>plain</textStyle>
  199.         <textHeight>12</textHeight>
  200.         <name>yup</name>
  201.         <script></script>
  202.     </part>
  203.     <part>
  204.         <id>13</id>
  205.         <type>button</type>
  206.         <visible> <true /> </visible>
  207.         <reserved5> 0 </reserved5>
  208.         <reserved4> 0 </reserved4>
  209.         <reserved3> 0 </reserved3>
  210.         <reserved2> 0 </reserved2>
  211.         <reserved1> 0 </reserved1>
  212.         <enabled> <true /> </enabled>
  213.         <rect>
  214.             <left>54</left>
  215.             <top>127</top>
  216.             <right>107</right>
  217.             <bottom>179</bottom>
  218.         </rect>
  219.         <style>rectangle</style>
  220.         <showName> <true /> </showName>
  221.         <highlight> <false /> </highlight>
  222.         <autoHighlight> <true /> </autoHighlight>
  223.         <sharedHighlight> <true /> </sharedHighlight>
  224.         <family>0</family>
  225.         <titleWidth>0</titleWidth>
  226.         <icon>14767</icon>
  227.         <textAlign>center</textAlign>
  228.         <font>Chicago</font>
  229.         <textSize>12</textSize>
  230.         <textStyle>plain</textStyle>
  231.         <name>About</name>
  232.         <script>on mouseUpgo previousend mouseUp</script>
  233.     </part>
  234.     <content>
  235.         <layer>background</layer>
  236.         <id>4</id>
  237.         <text><span class="style2"> mettre dans le projet dans Think Pascal 4.02 :</span><span class="style1">Libraries:RSRCRuntime.LibInterface.libLibraries:HyperXLib.LibInterfaces:HyperXCmd.pInterfaces:Processes.pInterfaces:GestaltEqu.pIsRunning.p</span><span class="style2">Listing de IsRunning.p :</span><span class="style1">UNIT IsRunning;INTERFACE USES  HyperXcmd, Processes, GestaltEqu; PROCEDURE main (paramPtr: XcmdPtr);IMPLEMENTATION CONST{ messages d'erreur et r├⌐sultats }  applRunning = 1;        { l'application est en train de tourner }  applNotRunning = 2;     { l'application ne tourne pas }  noGestalt = 3;            { il n'y a pas Gestalt dans le syst├¿me }  errGestalt = 4;            { gestalt a retourn├⌐ une erreur }  noProcess = 5;            { Le process manager est absent }  badSignature = 6;        { la signature ne fait pas 4 caract├¿res }  helpNeeded = 7;            { user asked for help }  _Unimplemented = $A89F;        { fichier Traps.p } FUNCTION askedForHelp (paramPtr: XcmdPtr; syntaxMsg, copyrightMsg: str255): BOOLEAN;  VAR   firstStr: str255; BEGIN  askedForHelp := FALSE;  IF paramPtr^.paramCount = 1 THEN   BEGIN    ZeroToPas(paramPtr, paramPtr^.params[1]^, firstStr);    IF firstStr = '?' THEN     BEGIN      paramPtr^.returnValue := PasToZero(paramPtr, syntaxMsg);      askedForHelp := TRUE;     END    ELSE IF firstStr = '!' THEN     BEGIN      paramPtr^.returnValue := PasToZero(paramPtr, copyrightMsg);      askedForHelp := TRUE;     END;   END; END; FUNCTION NumToolboxTraps: INTEGER;  CONST   _InitGraf = $A86E; BEGIN  IF NGetTrapAddress(_InitGraf, ToolTrap) = NGetTrapAddress($AA6E, ToolTrap) THEN   NumToolboxTraps := $200  ELSE   NumToolboxTraps := $400; END; FUNCTION GetTrapType (theTrap: INTEGER): TrapType;  CONST   TrapMask = $0800; BEGIN  IF BAND(theTrap, trapMask) > 0 THEN   GetTrapType := ToolTrap  ELSE   GetTrapType := OSTrap; END; FUNCTION trapAvailable (theTrap: INTEGER): BOOLEAN;  VAR   tType: TrapType; BEGIN  tType := GetTrapType(theTrap);  IF tType = ToolTrap THEN   BEGIN    theTrap := BAND(theTrap, $07FF);    IF theTrap > NumToolBoxTraps THEN     theTrap := _Unimplemented;   END;  TrapAvailable := NGetTrapAddress(theTrap, tType) <> NGetTrapAddress(_Unimplemented, ToolTrap); END; FUNCTION processAvail: OSErr;  CONST   _gestalt = $A1AD;  VAR   JoeLeBooleen: BOOLEAN;   erreur: OSErr;   myFeature: LONGINT;   myBit: INTEGER; BEGIN  processAvail := noErr;    { first assume there's no error }  JoeLeBooleen := TrapAvailable(_gestalt);  IF JoeLeBooleen = FALSE THEN   BEGIN    processAvail := noGestalt;    exit(processAvail);   END;{ gestalt is available, try it }  erreur := Gestalt(gestaltOSAttr, myFeature);  IF erreur <> noErr THEN   BEGIN    processAvail := errGestalt;    exit(processAvail);   END;{ no error for Gestalt man ! let's try process manager }  myBit := gestaltLaunchControl;  IF BitTst(@myFeature, 31 - myBit) = FALSE THEN   BEGIN    processAvail := noProcess;    exit(processAvail);   END;{ everything's allright, even process mgr is here. we can use it's procedures } END; FUNCTION findAProcess (signature: OSType): boolean;  VAR   process: ProcessSerialNumber;   infoRec: ProcessInfoRec;   aFSSpecPtr: FSSpecPtr; BEGIN  findAProcess := FALSE;        { assume FALSE to begin }  process.highLongOfPSN := 0;  process.lowLongOfPSN := kNoProcess;        { start from the beginning }  infoRec.processInfoLength := sizeOf(ProcessInfoRec);  infoRec.processName := StringPtr(NewPtr(32));  infoRec.processAppSpec := aFSSpecPtr;  WHILE (getNextProcess(process) = noErr) DO   BEGIN    IF GetProcessInformation(process, infoRec) = noErr THEN     BEGIN      IF (infoRec.processType = Longint('APPL')) AND (infoRec.processSignature = signature) THEN    { found a process }       BEGIN       findAProcess := TRUE;       EXIT(findAProcess);       END;     END;   END;    {while } END; FUNCTION isProcessRunning (paramPtr: XcmdPtr): OSErr;  VAR   erreur: OSErr;   tempStr: str255;   signature: OSType; BEGIN  IF askedForHelp(paramPtr, 'IsRunning( signature) where signature is 4 caps', 'IsRunning XFCN 1.0, March 15 1993, Pierre MATHIEU, for URA 1451') THEN   BEGIN    isProcessRunning := helpNeeded;    exit(isProcessRunning);   END;{ no help needed }  erreur := processAvail;  IF erreur <> noErr THEN   BEGIN    isProcessRunning := erreur;    exit(isProcessRunning);   END;{ les procedures du Process mgr sont ici, on peut faire le test }  IF paramPtr^.paramCount > 0 THEN   BEGIN    ZeroToPas(paramPtr, paramPtr^.params[1]^, tempStr);    IF (LENGTH(tempStr) <> 4) THEN     BEGIN      isProcessRunning := badSignature;      exit(isProcessRunning);     END;{ ce n'est pas une signatureΓǪ sortir, sinon, la signature fait 4 caract├¿res }    signature := OSType(LONGINT(tempStr));    IF findAProcess(signature) THEN     isProcessRunning := applRunning            { l'application est en train de tourner }    ELSE     isProcessRunning := applNotRunning;    { l'application ne tourne pas }   END; END; PROCEDURE main;  VAR   erreur: OSErr;   returnStr: str255; BEGIN  erreur := isProcessRunning(ParamPtr);  NumToString(INTEGER(erreur), returnStr);  IF erreur <> helpNeeded THEN   paramPtr^.returnValue := pasToZero(ParamPtr, returnStr); END;END.</span></text>
  238.     </content>
  239.     <content>
  240.         <layer>card</layer>
  241.         <id>8</id>
  242.         <text>WILD</text>
  243.     </content>
  244.     <content>
  245.         <layer>card</layer>
  246.         <id>9</id>
  247.         <text></text>
  248.     </content>
  249.     <content>
  250.         <layer>card</layer>
  251.         <id>11</id>
  252.         <text>IsRunning XFCN</text>
  253.     </content>
  254.     <content>
  255.         <layer>card</layer>
  256.         <id>12</id>
  257.         <text>Put a creator (or anything) in the field below, then click IsRunning</text>
  258.     </content>
  259.     <name></name>
  260.     <script></script>
  261. </card>
  262.  
  263.  
  264. card_4598.xml
  265. <?xml version="1.0" encoding="utf-8" ?>
  266. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  267. <card>
  268.     <id>4598</id>
  269.     <filler1>0</filler1>
  270.     <cantDelete> <false /> </cantDelete>
  271.     <showPict> <true /> </showPict>
  272.     <dontSearch> <false /> </dontSearch>
  273.     <owner>2758</owner>
  274.     <link rel="stylesheet" type="text/css" href="stylesheet_3269.css" />
  275.     <part>
  276.         <id>1</id>
  277.         <type>button</type>
  278.         <visible> <true /> </visible>
  279.         <reserved5> 0 </reserved5>
  280.         <reserved4> 0 </reserved4>
  281.         <reserved3> 0 </reserved3>
  282.         <reserved2> 0 </reserved2>
  283.         <reserved1> 0 </reserved1>
  284.         <enabled> <true /> </enabled>
  285.         <rect>
  286.             <left>426</left>
  287.             <top>13</top>
  288.             <right>475</right>
  289.             <bottom>60</bottom>
  290.         </rect>
  291.         <style>rectangle</style>
  292.         <showName> <false /> </showName>
  293.         <highlight> <false /> </highlight>
  294.         <autoHighlight> <true /> </autoHighlight>
  295.         <sharedHighlight> <true /> </sharedHighlight>
  296.         <family>0</family>
  297.         <titleWidth>0</titleWidth>
  298.         <icon>29114</icon>
  299.         <textAlign>center</textAlign>
  300.         <font>Chicago</font>
  301.         <textSize>12</textSize>
  302.         <textStyle>plain</textStyle>
  303.         <name>previous</name>
  304.         <script>on mouseUpgo to card id 2885end mouseUp</script>
  305.     </part>
  306.     <part>
  307.         <id>2</id>
  308.         <type>field</type>
  309.         <visible> <true /> </visible>
  310.         <dontWrap> <false /> </dontWrap>
  311.         <dontSearch> <false /> </dontSearch>
  312.         <sharedText> <false /> </sharedText>
  313.         <fixedLineHeight> <false /> </fixedLineHeight>
  314.         <autoTab> <false /> </autoTab>
  315.         <lockText> <true /> </lockText>
  316.         <rect>
  317.             <left>2</left>
  318.             <top>10</top>
  319.             <right>395</right>
  320.             <bottom>62</bottom>
  321.         </rect>
  322.         <style>rectangle</style>
  323.         <autoSelect> <false /> </autoSelect>
  324.         <showLines> <false /> </showLines>
  325.         <wideMargins> <false /> </wideMargins>
  326.         <multipleLines> <false /> </multipleLines>
  327.         <reservedFamily> 0 </reservedFamily>
  328.         <titleWidth>0</titleWidth>
  329.         <icon>0</icon>
  330.         <textAlign>left</textAlign>
  331.         <font>Times</font>
  332.         <textSize>48</textSize>
  333.         <textStyle>bold</textStyle>
  334.         <textHeight>64</textHeight>
  335.         <name>Nom</name>
  336.         <script></script>
  337.     </part>
  338.     <part>
  339.         <id>3</id>
  340.         <type>field</type>
  341.         <visible> <true /> </visible>
  342.         <dontWrap> <false /> </dontWrap>
  343.         <dontSearch> <false /> </dontSearch>
  344.         <sharedText> <false /> </sharedText>
  345.         <fixedLineHeight> <false /> </fixedLineHeight>
  346.         <autoTab> <false /> </autoTab>
  347.         <lockText> <false /> </lockText>
  348.         <rect>
  349.             <left>2</left>
  350.             <top>67</top>
  351.             <right>510</right>
  352.             <bottom>332</bottom>
  353.         </rect>
  354.         <style>scrolling</style>
  355.         <autoSelect> <false /> </autoSelect>
  356.         <showLines> <false /> </showLines>
  357.         <wideMargins> <false /> </wideMargins>
  358.         <multipleLines> <false /> </multipleLines>
  359.         <reservedFamily> 0 </reservedFamily>
  360.         <titleWidth>0</titleWidth>
  361.         <icon>0</icon>
  362.         <textAlign>left</textAlign>
  363.         <font>Geneva</font>
  364.         <textSize>9</textSize>
  365.         <textStyle>plain</textStyle>
  366.         <textHeight>12</textHeight>
  367.         <name></name>
  368.         <script></script>
  369.     </part>
  370.     <content>
  371.         <layer>card</layer>
  372.         <id>2</id>
  373.         <text>Source</text>
  374.     </content>
  375.     <content>
  376.         <layer>card</layer>
  377.         <id>3</id>
  378.         <text><span class="style2">ontent of the Think Pascal 4.02 projet</span><span class="style1"> IsRunning.╧Ç</span><span class="style2">  :</span><span class="style1">Libraries:RSRCRuntime.LibInterface.libLibraries:HyperXLib.LibInterfaces:HyperXCmd.pInterfaces:Processes.pInterfaces:GestaltEqu.pIsRunning.pIsRunning.p </span><span class="style2">source :</span><span class="style1">UNIT IsRunning;INTERFACE    USES        HyperXcmd, Processes, GestaltEqu;    PROCEDURE main (paramPtr: XcmdPtr);IMPLEMENTATION    CONST{ messages d'erreur et r├⌐sultats }        applRunning = 1;        { app is running }        applNotRunning = 2;     { app is not running }        noGestalt = 3;            { Gestalt not available }        errGestalt = 4;            { gestalt returns an error }        noProcess = 5;            { Process Manager not available }        badSignature = 6;        { signature = creator is not 4 caps long }        helpNeeded = 7;            { user asked for help }        _Unimplemented = $A89F;        { File Traps.p not included in the project }    FUNCTION askedForHelp (paramPtr: XcmdPtr; syntaxMsg, copyrightMsg: str255): BOOLEAN;        VAR            firstStr: str255;    BEGIN        askedForHelp := FALSE;        IF paramPtr^.paramCount = 1 THEN            BEGIN                ZeroToPas(paramPtr, paramPtr^.params[1]^, firstStr);                IF firstStr = '?' THEN                    BEGIN                        paramPtr^.returnValue := PasToZero(paramPtr, syntaxMsg);                        askedForHelp := TRUE;                    END                ELSE IF firstStr = '!' THEN                    BEGIN                        paramPtr^.returnValue := PasToZero(paramPtr, copyrightMsg);                        askedForHelp := TRUE;                    END;            END;    END;    FUNCTION NumToolboxTraps: INTEGER;        CONST            _InitGraf = $A86E;    BEGIN        IF NGetTrapAddress(_InitGraf, ToolTrap) = NGetTrapAddress($AA6E, ToolTrap) THEN            NumToolboxTraps := $200        ELSE            NumToolboxTraps := $400;    END;{ See Inside Macintosh VI }    FUNCTION GetTrapType (theTrap: INTEGER): TrapType;        CONST            TrapMask = $0800;    BEGIN        IF BAND(theTrap, trapMask) > 0 THEN            GetTrapType := ToolTrap        ELSE            GetTrapType := OSTrap;    END;{ See Inside Macintosh VI }    FUNCTION trapAvailable (theTrap: INTEGER): BOOLEAN;        VAR            tType: TrapType;    BEGIN        tType := GetTrapType(theTrap);        IF tType = ToolTrap THEN            BEGIN                theTrap := BAND(theTrap, $07FF);                IF theTrap > NumToolBoxTraps THEN                    theTrap := _Unimplemented;            END;        TrapAvailable := NGetTrapAddress(theTrap, tType) <> NGetTrapAddress(_Unimplemented, ToolTrap);    END;{ See Inside Macintosh VI }    FUNCTION processAvail: OSErr;        CONST            _gestalt = $A1AD;        VAR            JoeLeBooleen: BOOLEAN;            erreur: OSErr;            myFeature: LONGINT;            myBit: INTEGER;    BEGIN        processAvail := noErr;    { first assume there's no error }        JoeLeBooleen := TrapAvailable(_gestalt);        IF JoeLeBooleen = FALSE THEN            BEGIN                processAvail := noGestalt;                exit(processAvail);            END;{ gestalt is available, let's try it }        erreur := Gestalt(gestaltOSAttr, myFeature);        IF erreur <> noErr THEN            BEGIN                processAvail := errGestalt;                exit(processAvail);            END;{ no error for Gestalt man ! let's try the Process Manager }        myBit := gestaltLaunchControl;        IF BitTst(@myFeature, 31 - myBit) = FALSE THEN            BEGIN                processAvail := noProcess;                exit(processAvail);            END;{ everything's allright, even process mgr is here. we can use it's procedures }    END;    FUNCTION findAProcess (signature: OSType): boolean;        VAR            process: ProcessSerialNumber;            infoRec: ProcessInfoRec;            aFSSpecPtr: FSSpecPtr;    BEGIN        findAProcess := FALSE;        { assume FALSE to begin }        process.highLongOfPSN := 0;        process.lowLongOfPSN := kNoProcess;        { start from the beginning }        infoRec.processInfoLength := sizeOf(ProcessInfoRec);        infoRec.processName := StringPtr(NewPtr(32));        infoRec.processAppSpec := aFSSpecPtr;        WHILE (getNextProcess(process) = noErr) DO            BEGIN                IF GetProcessInformation(process, infoRec) = noErr THEN                    BEGIN                        IF (infoRec.processType = Longint('APPL')) AND (infoRec.processSignature = signature) THEN{ found a process }                            BEGIN                                findAProcess := TRUE;                                EXIT(findAProcess);                            END;                    END;            END;    {while }    END;{ See Inside Macintosh VI }    FUNCTION isProcessRunning (paramPtr: XcmdPtr): OSErr;        VAR            erreur: OSErr;            tempStr: str255;            signature: OSType;    BEGIN        IF askedForHelp(paramPtr, 'IsRunning( signature) where signature is 4 caps', 'IsRunning XFCN 1.0, March 15 1993, Pierre MATHIEU, for URA 1451') THEN            BEGIN                isProcessRunning := helpNeeded;                exit(isProcessRunning);            END;{ no help needed }        erreur := processAvail;        IF erreur <> noErr THEN            BEGIN                isProcessRunning := erreur;                exit(isProcessRunning);            END;{ The Process Mgr  procedures are available }        IF paramPtr^.paramCount > 0 THEN            BEGIN                ZeroToPas(paramPtr, paramPtr^.params[1]^, tempStr);                IF (LENGTH(tempStr) <> 4) THEN                    BEGIN                        isProcessRunning := badSignature;                        exit(isProcessRunning);                    END;{ This is no signatureΓǪ exit, else, signature is 4 caps long }                signature := OSType(LONGINT(tempStr));                IF findAProcess(signature) THEN                    isProcessRunning := applRunning            { appl is running }                ELSE                    isProcessRunning := applNotRunning;    { appl is not running }            END;    END;    PROCEDURE main;        VAR            erreur: OSErr;            returnStr: str255;    BEGIN        erreur := isProcessRunning(ParamPtr);        NumToString(INTEGER(erreur), returnStr);        IF erreur <> helpNeeded THEN            paramPtr^.returnValue := pasToZero(ParamPtr, returnStr);    END;END.</span></text>
  379.     </content>
  380.     <name></name>
  381.     <script></script>
  382. </card>
  383.  
  384.  
  385. card_4874.xml
  386. <?xml version="1.0" encoding="utf-8" ?>
  387. <!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
  388. <card>
  389.     <id>4874</id>
  390.     <filler1>0</filler1>
  391.     <cantDelete> <false /> </cantDelete>
  392.     <showPict> <true /> </showPict>
  393.     <dontSearch> <false /> </dontSearch>
  394.     <owner>2758</owner>
  395.     <link rel="stylesheet" type="text/css" href="stylesheet_3269.css" />
  396.     <part>
  397.         <id>1</id>
  398.         <type>field</type>
  399.         <visible> <true /> </visible>
  400.         <dontWrap> <false /> </dontWrap>
  401.         <dontSearch> <false /> </dontSearch>
  402.         <sharedText> <false /> </sharedText>
  403.         <fixedLineHeight> <false /> </fixedLineHeight>
  404.         <autoTab> <false /> </autoTab>
  405.         <lockText> <false /> </lockText>
  406.         <rect>
  407.             <left>57</left>
  408.             <top>1</top>
  409.             <right>455</right>
  410.             <bottom>218</bottom>
  411.         </rect>
  412.         <style>scrolling</style>
  413.         <autoSelect> <false /> </autoSelect>
  414.         <showLines> <false /> </showLines>
  415.         <wideMargins> <false /> </wideMargins>
  416.         <multipleLines> <false /> </multipleLines>
  417.         <reservedFamily> 0 </reservedFamily>
  418.         <titleWidth>0</titleWidth>
  419.         <icon>0</icon>
  420.         <textAlign>left</textAlign>
  421.         <font>Geneva</font>
  422.         <textSize>12</textSize>
  423.         <textStyle>plain</textStyle>
  424.         <textHeight>16</textHeight>
  425.         <name>Description</name>
  426.         <script></script>
  427.     </part>
  428.     <part>
  429.         <id>2</id>
  430.         <type>field</type>
  431.         <visible> <true /> </visible>
  432.         <dontWrap> <false /> </dontWrap>
  433.         <dontSearch> <false /> </dontSearch>
  434.         <sharedText> <false /> </sharedText>
  435.         <fixedLineHeight> <false /> </fixedLineHeight>
  436.         <autoTab> <false /> </autoTab>
  437.         <lockText> <false /> </lockText>
  438.         <rect>
  439.             <left>57</left>
  440.             <top>223</top>
  441.             <right>455</right>
  442.             <bottom>334</bottom>
  443.         </rect>
  444.         <style>scrolling</style>
  445.         <autoSelect> <false /> </autoSelect>
  446.         <showLines> <false /> </showLines>
  447.         <wideMargins> <false /> </wideMargins>
  448.         <multipleLines> <false /> </multipleLines>
  449.         <reservedFamily> 0 </reservedFamily>
  450.         <titleWidth>0</titleWidth>
  451.         <icon>0</icon>
  452.         <textAlign>left</textAlign>
  453.         <font>Geneva</font>
  454.         <textSize>10</textSize>
  455.         <textStyle>plain</textStyle>
  456.         <textHeight>13</textHeight>
  457.         <name>Description2</name>
  458.         <script></script>
  459.     </part>
  460.     <part>
  461.         <id>3</id>
  462.         <type>button</type>
  463.         <visible> <true /> </visible>
  464.         <reserved5> 0 </reserved5>
  465.         <reserved4> 0 </reserved4>
  466.         <reserved3> 0 </reserved3>
  467.         <reserved2> 0 </reserved2>
  468.         <reserved1> 0 </reserved1>
  469.         <enabled> <true /> </enabled>
  470.         <rect>
  471.             <left>459</left>
  472.             <top>287</top>
  473.             <right>508</right>
  474.             <bottom>334</bottom>
  475.         </rect>
  476.         <style>rectangle</style>
  477.         <showName> <false /> </showName>
  478.         <highlight> <false /> </highlight>
  479.         <autoHighlight> <true /> </autoHighlight>
  480.         <sharedHighlight> <true /> </sharedHighlight>
  481.         <family>0</family>
  482.         <titleWidth>0</titleWidth>
  483.         <icon>29114</icon>
  484.         <textAlign>center</textAlign>
  485.         <font>Chicago</font>
  486.         <textSize>12</textSize>
  487.         <textStyle>plain</textStyle>
  488.         <name>previous</name>
  489.         <script>on mouseUpgo to card id 2885end mouseUp</script>
  490.     </part>
  491.     <content>
  492.         <layer>card</layer>
  493.         <id>1</id>
  494.         <text><span class="style5">                                            </span><span class="style7">IsRunning 1.0</span><span class="style5">                                          by Pierre MATHIEU</span><span class="style6">WARNING</span><span class="style5">   IsRunning works on HC 2.x and system > 6.04, but it will return an accurate result (that is use the Process Manager) only with System > 7.0</span><span class="style6">DESCRIPTION</span><span class="style5">  IsRunning XFCN tells if the an application is running.</span><span class="style6">SYNTAX</span><span class="style5">    StrWidth("signature")</span><span class="style6">PARAMETERS</span><span class="style5">   signature is the creator of the application. It must be 4 caps long.   Using "!" and "?" as parameter will return an online help (resp. copyright and syntax).</span><span class="style6">USING</span><span class="style5">   external returns :   1 : application is running   2 : application is not running   3 : Gestalt not available   4 : Gestalt error   5 : Process Manager not available   6 : signature is not 4 caps long</span></text>
  495.     </content>
  496.     <content>
  497.         <layer>card</layer>
  498.         <id>2</id>
  499.         <text><span class="style1">sRunning is freeware and can't be sold.Copy it freely as long as it is not modified.Send postcards, comments, bug reports to :Pierre MATHIEU1, All├⌐e CarnotF-69 580 SATHONAY-CAMPFRANCEinternet : mathieu@biomserv.univ-lyon1.frIf you use this XFCN, please e-mail, or send me a postcard._____________________________________________________This XFCN was developed for the URA 1451. It is used in the ADE software, which is a  </span><span class="style2">Program library  for the Analysis of Environmental Data.</span><span class="style1">For information, please contact :</span><span class="style2">D. Chessel & S. Dol├⌐dec</span><span class="style1">Ecologie des eaux douces et des grands fleuves - URA CNRS 1451Univ. Lyon 1, 43 Bd du 11 Novembre 1918F-69622 Villeurbanne Cedex, FranceTel :  72 44 82 77 or 72 44 80 00 poste 39-45internet : chessel@biomserv.univ-lyon1.frinternet : sylvain@biomserv.univ-lyon1.frFax :  72 43 11 41</span></text>
  500.     </content>
  501.     <name></name>
  502.     <script></script>
  503. </card>
  504.  
  505.  
  506.